package com.lprotect.web.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.lprotect.web.dto.req.LProtectCardListReqDTO;
import com.lprotect.web.entity.LUserInfo;
import com.lprotect.web.mapper.LUserInfoMapper;
import com.lprotect.web.service.LProtectService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * @author lbj
 */
@Service
@Slf4j
public class LProtectServiceImpl implements LProtectService {

    @Resource
    private LUserInfoMapper lUserInfoMapper;
    @Override
    public IPage<LUserInfo> selectPageList(LProtectCardListReqDTO reqDTO) {
        IPage<LUserInfo> page = new Page<>(reqDTO.getPageNum(), reqDTO.getPageSize());
        LambdaQueryWrapper<LUserInfo> queryWrapper = new LambdaQueryWrapper<>();
        // 使用reqDTO的userName属性作为查询条件
        //queryWrapper.eq(LUserInfo::getUserName, reqDTO.getUserName());
        IPage<LUserInfo> lUserInfoIPage = lUserInfoMapper.selectPage(page, queryWrapper);
        return lUserInfoIPage;
    }

}
